package com.example.JcGQS.enums;

/**
 * 发票种类枚举类
 * @author 末日
 * @date 2023年11月17日
 */
public enum InvoiceStateEnum {
    GENERAL_INVOICE("0","普票"),
    SPECIAL_TICKET("1","专票"),
    RECEIPT("2","收据"),
    NO_INVOICE("3","无发票");


    private String value;
    private String state;
    public String getValue() {
        return value;
    }
    /**
     * @return the state
     */
    public String getState() {
        return state;
    }
    InvoiceStateEnum(String value, String state) {
        this.value = value;
        this.state = state;
    }

    public static String getDescriptionByCode(String value) {
        for (InvoiceStateEnum status : InvoiceStateEnum.values()) {
            if (status.value.equals(value)) {
                return status.getState();
            }
        }
        return null; // 或者抛出异常，表示未找到对应的枚举值
    }
}
